import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/attachment/document/getList',
    method: 'post',
    data: query
  })
}

export function fetchDocumentAvailable(query) {
  return request({
    url: '/attachment/document/getAvailable',
    method: 'post',
    data: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/attachment/document/getDetail',
    method: 'post',
    data: { id }
  })
}

export function saveDocument(id) {
  return request({
    url: '/attachment/document/save',
    method: 'post',
    data: id
  })
}

export function removeDocumentByID(id) {
  return request({
    url: '/attachment/document/delete',
    method: 'post',
    data: id
  })
}

export function changeDocumentStatusByID(id) {
  return request({
    url: '/attachment/document/change-status',
    method: 'post',
    data: id
  })
}

